﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class iPhoneXOffset : MonoBehaviour
{
	public Vector2 OffsetUp;
	public Vector2 OffsetBottom;
	void Awake ()
	{
		if (Config.Instance.iPhoneX) {
			RectTransform rt = transform as RectTransform;
			if (rt != null) {
				if (rt.anchorMin == Vector2.zero && rt.anchorMax == Vector2.one) {
					rt.offsetMin = OffsetBottom;
					rt.offsetMax = -OffsetUp;
				} else {
					rt.anchoredPosition = OffsetBottom;
				}
			}
		}
	}
}
